/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			prolit_debug.h
  \date			November 2012
  \author		TNick

  \brief		Contains definitions for debugging cad-play-ground package

*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __CPG_DEBUG_INC__
#define __CPG_DEBUG_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

/* we make sure we have the user settings before this file */
#include	<cpg/cpg_config.h>

/*  INCLUDES    ============================================================ */
//
//
//
//
/*  DEFINITIONS    --------------------------------------------------------- */


/**
*	@brief The PGDBG_Codes enum defines codes that may be used to debug the library
*
*	Each value may be used with the IS_DEBUG_ID_ALLOWED in cpg_config.h to
*	enable or disable presenting messages tagged with that code.
*
*	At run time (when QT_NO_DEBUG is defined) these messages are removed
*	entierly from the output (notice the PGDBG... group of macros).
*/
enum	PGDBG_Codes		{
	PGDBG_CTORDTOR,		/* all constructors and destructors */
	PGDBG_V_CTORDTOR,	/* constructors and destructors called a lot */

	PGDBG_LIBRARY,		/* library in general */
	PGDBG_DOCUMENT,		/* CpgDoc document */

	PGDBG_MW,			/* main window of a program */
	PGDBG_A_MDI,		/* MW_BasicMdi class*/
	PGDBG_A_VIEW,		/* ViewImpl class*/
	PGDBG_A_FILE,		/*  class*/
	PGDBG_A_HELP,		/*  class*/
	PGDBG_A_EDIT,		/*  class*/

	PGDBG_PLGIN,		/* Plug-in related functionality */

	PGDBG_MAX
};


#ifndef	ENABLE_LOGGING
#	ifndef QT_NO_DEBUG
#		define	ENABLE_LOGGING	1
#	else
#		define	ENABLE_LOGGING	0
#	endif
#endif

#if ENABLE_LOGGING
#	include <QDebug>

/* IS_DEBUG_ID_ALLOWED should be defined in cpg_config.h */
#ifndef	IS_DEBUG_ID_ALLOWED
#	define	IS_DEBUG_ID_ALLOWED( id )
#endif

#	define PGDBG(id,txt)	\
	if ( IS_DEBUG_ID_ALLOWED( id ) ) \
	qDebug() << txt
#	define PGDBG2(id,txt1,txt2)	\
	if ( IS_DEBUG_ID_ALLOWED( id ) ) \
	qDebug() << txt1 << txt2
#	define PGDBG3(id,txt1,txt2,txt3)	\
	if ( IS_DEBUG_ID_ALLOWED( id ) ) \
	qDebug() << txt1 << txt2 << txt3

#else
#	define PGDBG(id,txt)
#	define PGDBG2(id,txt1,txt2)
#	define PGDBG3(id,txt1,txt2,txt3)
#endif

/*  DEFINITIONS    ========================================================= */
//
//
//
//
/*  DATA    ---------------------------------------------------------------- */

/*  DATA    ================================================================ */
//
//
//
//
/*  FUNCTIONS    ----------------------------------------------------------- */

/*  FUNCTIONS    =========================================================== */
//
//
//
//
#endif // __CPG_DEBUG_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
